/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ggsoft.timetracker.domain;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.appfuse.model.User;
import org.hibernate.search.annotations.DocumentId;

/**
 *
 * @author giovanella
 * @date May 17, 2014
 */
@Entity
@Table(name = "employees")
public class Employee implements Serializable {
    private Long id;
    private String cedula;
    private User user;
    private String status;
    private Department department;
    private Employee supervisor;
    private byte[] imagen;

    public Employee() {
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @DocumentId
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(length = 50)
    public String getCedula() {
        return cedula;
    }

    public void setCedula(String cedula) {
        this.cedula = cedula;
    }        

    @Column(length = 50)
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }        

    @ManyToOne
    @JoinColumn(name="user_id")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }    

    @ManyToOne
    @JoinColumn(name="department_id")
    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }              

    @ManyToOne
    @JoinColumn(name="supervisor_id")
    public Employee getSupervisor() {
        return supervisor;
    }
    
    public void setSupervisor(Employee supervisor) {
        this.supervisor = supervisor;
    }

    @Column(length = 250)
    public byte[] getImagen() {
        return imagen;
    }

    public void setImagen(byte[] imagen) {
        this.imagen = imagen;
    }        
}
